package com.java.cloud.controller;


import com.java.cloud.entity.SysChannelInfo;
import com.java.cloud.service.SysChannelInfoService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("sysChannelInfo")
public class SysChannelInfoController{


    @Autowired
    private SysChannelInfoService sysChannelInfoService;


    public void insertChannelInfo(@Param("sysChannelInfo") SysChannelInfo sysChannelInfo,
                                  @Param("saleRangeId") String saleRangeId,
                                  @Param("sellAreaId") String sellAreaId){
        if (!StringUtils.isEmpty(sysChannelInfo)||!StringUtils.isEmpty(saleRangeId)||!StringUtils.isEmpty(sellAreaId)){
            sysChannelInfoService.insertChannel(sysChannelInfo);
            String channelId=sysChannelInfo.getId();
            sysChannelInfoService.updSaleId(saleRangeId,channelId);
            sysChannelInfoService.updSellAreaId(sellAreaId,channelId);
        }

    }










}